home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource3 / 113_01 / a15.doc < prev    next >
Encoding:
Text File  |  1985-03-11  |  29.6 KB  |  851 lines

  1. /*
  2.     HEADER:        CUG113;
  3.     TITLE:        1802 Cross-Assembler (BDS C Version);
  4.     FILENAME:    A15.DOC;
  5.     VERSION:    1.2;
  6.     DATE:        07/22/1985;
  7.  
  8.     DESCRIPTION:    "This program lets you use your CP/M-80-based computer
  9.             to assemble code for the RCA 1802, 1804, 1805, 1805A,
  10.             1806, AND 1806A microprocessors.  The program is
  11.             written in BDS C for the best possible performance on
  12.             8-bit machines.  All assembler features are supported
  13.             except relocation, linkage, listing control, and
  14.             macros.";
  15.  
  16.     KEYWORDS:    Software Development, Assemblers, Cross-Assemblers,
  17.             RCA, CDP1802, CDP1805A;
  18.  
  19.     SEE-ALSO:    CUG149, 1805A Cross-Assembler (Portable);
  20.  
  21.     SYSTEM:        CP/M-80;
  22.     COMPILERS:    BDS C;
  23.  
  24.     WARNINGS:    "This package is specifically tailored to CP/M-80
  25.             machines and the rather non-standard, but high-
  26.             performance BDS C compiler.  For other environments,
  27.             use the portable version of this package on CUG149.";
  28.  
  29.     AUTHORS:    William C. Colley III;
  30. */
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                      1805A/1802 Cross-assembler
  42.  
  43.  
  44.                              Version 1.2
  45.  
  46.  
  47.          Copyright (c) 1980, 82, 83, 85 William C. Colley III
  48.  
  49.  
  50.  
  51.                       The Manual Such As It Is.
  52.  
  53. 1805A Cross-assembler User Manual                              Page  1
  54.  
  55.  
  56. Table of Contents
  57.  
  58. 1.0       Format of Cross-assembler Commands........................ 2
  59.  
  60.      1.1  Command Strings........................................... 2
  61.      1.2  Options................................................... 2
  62.      1.3  Examples.................................................. 2
  63.  
  64. 2.0       Format of Cross-assembler Source Files.................... 4
  65.  
  66.      2.1  Statements................................................ 4
  67.      2.2  Symbols................................................... 5
  68.      2.3  Numeric Constants......................................... 5
  69.      2.4  Strings................................................... 6
  70.  
  71. 3.0       Expression Evaluation..................................... 7
  72.  
  73. 4.0       1805A Instructions........................................ 8
  74.  
  75.      4.1  No Argument Group......................................... 8
  76.      4.2  Register Group............................................ 8
  77.      4.3  8-bit Immediate Group..................................... 8
  78.      4.4  Short Branch Group........................................ 9
  79.      4.5  Long Branch Group......................................... 9
  80.      4.6  Input/Output Group........................................ 9
  81.      4.7  2-Argument Group.......................................... 9
  82.  
  83. 5.0       Pseudo-operations.........................................10
  84.  
  85.      5.1  BLK.......................................................10
  86.      5.2  BYTE......................................................10
  87.      5.3  Conditional Assembly......................................10
  88.      5.4  CPU.......................................................11
  89.      5.5  END.......................................................11
  90.      5.6  EQU.......................................................12
  91.      5.7  LOAD......................................................12
  92.      5.8  ORG.......................................................12
  93.      5.9  PAGE......................................................13
  94.      5.10 SET.......................................................13
  95.      5.11 TEXT......................................................13
  96.      5.12 WORD......................................................13
  97.  
  98. 6.0  Error Messages.................................................14
  99.  
  100. 7.0  Assembler Abort Conditions.....................................16
  101.  
  102. 8.0  Compiling the Assembler........................................17
  103.  
  104. 9.0  Final Comments.................................................18
  105.  
  106. 1805A Cross-assembler User Manual                              Page  2
  107.  
  108.  
  109. 1.0  Format of Cross-assembler Commands
  110.  
  111. 1.1  Command Strings
  112.  
  113.      To run the 1805A cross-assembler, type the following command
  114. line:
  115.  
  116.           A>a15 filename options
  117.  
  118.           filename: The name of the source input file is filename.rca,
  119.                     the list can go to filename.prn, and the hex file
  120.                     can go to filename.hex.  If any type is appended
  121.                     to the filename, it is ignored.
  122.  
  123.           options:  See next section.
  124.  
  125.  
  126. 1.2  Options
  127.  
  128.      The source file comes from the currently logged disk drive unless
  129.      it is redirected by putting the string "sd" in the options field.
  130.      "s" specifies the source file and "d" is a device code from the
  131.      following list:
  132.  
  133.           a, b, c, d     disk drives
  134.           -              the currently logged-in disk drive
  135.  
  136.      Lines of input containing errors will always be output to the
  137.      console device.  If the full listing is desired, it must be
  138.      called for by putting the string "ld" in the options field.  "l"
  139.      specifies the list file and "d" is a device code as per the
  140.      source file or one of the following:
  141.  
  142.           x              console device
  143.           y              list device
  144.  
  145.      The hex file will not be output unless called for with the string
  146.      "hd" with device codes as per the list file.
  147.  
  148.      Options must be run together into a single string with no
  149.      embedded blanks.
  150.  
  151.  
  152. 1.3  Examples
  153.  
  154.      A>a15 barf               source -- a:barf.rca
  155.                               list   -- none
  156.                               hex    -- none
  157.  
  158.      A>a15 barf sblxha        source -- b:barf.rca
  159.                               list   -- con:
  160.                               hex    -- a:barf.hex
  161.  
  162. 1805A Cross-assembler User Manual                              Page  3
  163.  
  164.  
  165.      A>a15 barf ly            source -- a:barf.rca
  166.                               list   -- lst:
  167.                               hex    -- none
  168.  
  169.      A>b:a15 barf sbh-        source -- b:barf.rca
  170.                               list   -- none
  171.                               hex    -- a:barf.hex
  172.  
  173.      B>a:a15 barf h-          source -- b:barf.rca
  174.                               list   -- none
  175.                               hex    -- b:barf.rca
  176.  
  177. 1805A Cross-assembler User Manual                              Page  4
  178.  
  179.  
  180. 2.0  Format of Cross-assembler Source Files
  181.  
  182.      Lines of source input are terminated with CR/LF pairs.
  183.      Internally, the character before the LF is discarded, so if the
  184.      CR is missing, the last character of the line will be eaten up.
  185.      The internal line buffer will hold a 120-character line.  This
  186.      may be changed by altering the "#define LINLEN 120" statement in
  187.      a15.h and recompiling the cross-assembler.  Excess characters in
  188.      the line are thrown out.
  189.  
  190.      Lower case letters are converted to upper case in as few places
  191.      as possible.  They are:
  192.  
  193.           1)  In opcodes,
  194.  
  195.           2)  In checking for keywords such as NOT, and
  196.  
  197.           3)  In command strings.
  198.  
  199.      This means that "not", "NOT", "Not", etc. are all possible
  200.      spellings of the logical inversion operator.  This also means
  201.      that "foo" and "FOO" are different symbols.  Watch this if you
  202.      start encountering U errors of symbols that you "know" you
  203.      defined.
  204.  
  205.  
  206. 2.1  Statements
  207.  
  208.      Source files input to the cross-assembler consist of statements
  209.      of the form:
  210.  
  211.           [label]   [opcode   [arguments]]   [;comments]
  212.  
  213.      Labels are recognized by their beginning in column 1.  If it
  214.      doesn't begin there, it is assumed to be an opcode.  Labels are
  215.      assigned the current program counter value unless the line's
  216.      opcode is "EQU" or "SET".
  217.  
  218.      Opcodes may be either 1805A machine instruction mnemonics or
  219.      pseudo-ops (i.e. assembler directives).
  220.  
  221.      The arguments following the opcode will vary with the opcode. In
  222.      the case of opcodes such as "NOP", they may be absent entirely.
  223.  
  224.      Lines terminate with either a CR/LF pair or a semicolon that is
  225.      not embedded in a quoted string.  Anything after a semicolon is
  226.      ignored by the assembler, but will appear in the listing.  Note
  227.      that a semicolon in column 1 will make the entire line a comment.
  228.  
  229. 1805A Cross-assembler User Manual                              Page  5
  230.  
  231.  
  232. 2.2  Symbols
  233.  
  234.      Symbols may be of any length, but only the first 8 characters are
  235.      significant.  This may be changed by changing the "#define SYMLEN
  236.      8" statement in a15.h and recompiling the assembler.  Note that
  237.      this increases the storage required by the symbol table as each
  238.      entry in the symbol table sits on SYMLEN+2 bytes of storage.  The
  239.      following characters are legal in a symbol:
  240.  
  241.           A-Z  a-z  !    #    $    %    &    .    :    ?    @    [
  242.                     \    ]    ^    _    `    {    |    }
  243.  
  244.      Note that symbols may not begin with 0-9 as this would make it
  245.      impossible to tell numbers from symbols.
  246.  
  247.      A special symbol $ is always equal to the address of the first
  248.      byte of code generated by a given line.
  249.  
  250.  
  251. 2.3  Numeric Constants
  252.  
  253.      The default base for numeric constants is decimal.  Putting a
  254.      trailing H, D, Q, O, or B onto the number will override the
  255.      default base.  The base designators may be in either lower or
  256.      upper case and are as follows:
  257.  
  258.           H    Hexidecimal    (Note that for A-F, lower case is
  259.                               converted to upper case.)
  260.           D    Decimal
  261.  
  262.           O Q  Octal          (Either O or Q will do.)
  263.  
  264.           B    Binary
  265.  
  266.      Numbers are 16-bit unsigned quantities.  Overflows from the upper
  267.      byte are ignored with no error flagged.  For example:
  268.  
  269.           0fedcbh        evaluates to edcb hex
  270.           000111000b     evaluates to 0039 hex
  271.           035Q           evaluates to 001d hex
  272.           128            evaluates to 0080 hex
  273.           1feh           evaluates to 01fe hex
  274.  
  275.      Numbers are recognized by their first character of 0-9, so make
  276.      sure that hex numbers have a zero padded onto the front if
  277.      needed.
  278.  
  279.      A character constant is a string composed of zero, one, or two
  280.      ASCII characters delimited by either single or double quotes (''
  281.      or "").  Note that single quotes only balance single quotes and
  282.  
  283. 1805A Cross-assembler User Manual                              Page  6
  284.  
  285.  
  286.      double quotes only balance double quotes.  Thus, a character
  287.      constant of 22 hex can be specified by '"'.  For example:
  288.  
  289.           "ab"           evaluates to 6162 hex
  290.           ""             evaluates to 0000 hex
  291.           "'"            evaluates to 0022 hex
  292.           'A'            evaluates to 0041 hex
  293.  
  294.      Note that in the two-byte character constant, the left-hand
  295.      character will appear in the upper-order byte and the right-hand
  296.      character will appear in the lower-order byte.
  297.  
  298.  
  299. 2.4  Strings
  300.  
  301.      Strings are formed in the same way as character constants except
  302.      that they may be of any length up to and including 255
  303.      characters.  The first character will be placed in the
  304.      lowest-order memory byte.  A line-feed character may not be
  305.      embedded in a string as it will yield a quote imbalance error.
  306.      Note that strings are only valid in the argument field of a
  307.      "TEXT" pseudo-op.
  308.  
  309. 1805A Cross-assembler User Manual                              Page  7
  310.  
  311.  
  312. 3.0  Expression Evaluation
  313.  
  314.      The following operators are allowed in expressions.  The
  315.      operators are listed in order of precedence.
  316.  
  317.           Unary +   Unary -
  318.  
  319.           *    /    MOD  SHL  SHR
  320.  
  321.           +    -
  322.  
  323.           >    >=   <    <=   <>   =    (These can also be written as
  324.                                         GT, GE, LT, LE, NE, and EQ.)
  325.  
  326.           NOT                           (1's complement)
  327.  
  328.           AND
  329.  
  330.           OR   XOR
  331.  
  332.           LOW  HIGH
  333.  
  334.      Parentheses are used to change the order of precedence.  During
  335.      evaluation of an expression, as soon as a new operator is
  336.      encountered that has precedence less than or equal to the last
  337.      operator encountered, all operations up to the new operator are
  338.      performed.  That is, subexpressions involving operators of higher
  339.      precedence are computed first.
  340.  
  341.      All operators except +, -, *, /, =, <>, >=, <=, >, and < must be
  342.      separated from their operands by at least one space or tab.
  343.  
  344.      The operation "HIGH mumble" is equivalent to "mumble SHR 8" and
  345.      the operation "LOW mumble" is equivalent to "mumble AND 0ffh".
  346.  
  347.      The relational operators (GE, EQ, etc.) evaluate to 0ffffh if the
  348.      relationship is true, 0 if it is false.
  349.  
  350.      Expressions are terminated by commas, semicolons, or CR/LF pairs.
  351.  
  352. 1805A Cross-assembler User Manual                              Page  8
  353.  
  354.  
  355. 4.0  1805A Instructions
  356.  
  357.      The instructions of the 1805A microprocessor fall into several
  358.      catagories.  Most require one or more arguments, though some
  359.      permit none.  Blanks may be used freely throughout the argument
  360.      field (except within symbols or operators such as NOT and <=) to
  361.      enhance the readability of the source code.  The basic syntax is
  362.      as follows:
  363.  
  364.           [label]   SEX       expression          ;comments.
  365.  
  366.  
  367. 4.1  No Argument Group
  368.  
  369.      This group contains the following opcodes:
  370.  
  371.           ADC       ADD       AND       CID       CIE       DADC
  372.           DADD      DIS       DSM       DSMB      DTC       ETQ
  373.           GEC       IDL       IRX       LDC       LDX       LSDF
  374.           LSIE      LSKP      LSNF      LSNQ      LSNZ      LSQ
  375.           LSZ       MARK      NOP       OR        REQ       RET
  376.           RSHL      RSHR      SAV       SCM1      SCM2      SD
  377.           SDB       SEQ       SHL       SHLC      SHR       SHRC
  378.           SKP       SM        SMB       SPM1      SPM2      STM
  379.           STPC      STXD      XID       XIE       XOR
  380.  
  381.      These opcodes permit no arguments.
  382.  
  383.  
  384. 4.2  Register Group
  385.  
  386.      This group contains the following opcodes:
  387.  
  388.           DEC       GHI       GLO       INC       LDA       LDN
  389.           PHI       PLO       RLXA      RNX       RSXD      SEP
  390.           SEX       SRET      STR
  391.  
  392.      This group requires one argument in the range 0-15.  The labels
  393.      R0, R1, ..., R9, RA, RB, ..., RF are predefined by the assembler
  394.      for specifying registers in these instructions.  If the argument
  395.      is out of range, a register (R) error is flagged.
  396.  
  397.      Note that a LDN R0 instruction will draw a register (R) error as
  398.      its opcode is used for the IDL instruction.
  399.  
  400.  
  401. 4.3  8-bit Immediate Group
  402.  
  403.      This group contains the following opcodes:
  404.  
  405.           ADCI      ADDI      ANI       DACI      DADI      DSBI
  406.           DSMI      LDI       ORI       SDBI      SDI       SMBI
  407.           SMI       XRI
  408.  
  409. 1805A Cross-assembler User Manual                              Page  9
  410.  
  411.  
  412.      This group requires one argument between -128 and 255.  If the
  413.      argument is out of range, a value (V) error is flagged.
  414.  
  415.  
  416. 4.4  Short Branch Group
  417.  
  418.      This group contains the following opcodes:
  419.  
  420.           B1        B2        B3        B4        BCI       BDF
  421.           BGE       BL        BM        BN1       BN2       BN3
  422.           BN4       BNF       BNQ       BNZ       BPZ       BQ
  423.           BR        BZ        BXI       NBR
  424.  
  425.      This group requires one argument whose high-order byte is equal
  426.      to the high-order byte of $+1 ($+2 for BCI and BXI).  If the
  427.      high-order bytes do not match, a branch (B) error is flagged.
  428.  
  429.  
  430. 4.5  Long Branch Group
  431.  
  432.      This group contains the following opcodes:
  433.  
  434.           LBDF      LBNF      LBNQ      LBNZ      LBQ       LBR
  435.           LBZ       NLBR
  436.  
  437.      This group requires one argument having any value.
  438.  
  439.  
  440. 4.6  Input/Output Group
  441.  
  442.      This group contains the following opcodes:
  443.  
  444.           INP       OUT
  445.  
  446.      This group requires one argument in the range 1-7.  If the
  447.      argument is out of range, a value (V) error is flagged.
  448.  
  449.  
  450. 4.7  2-Argument Group
  451.  
  452.      This group contains the following opcodes:
  453.  
  454.           DBNZ      RLDI      SCAL
  455.  
  456.      This group requires two arguments. The first argument is in the
  457.      range 0-15 as per the register group.  The second argument can
  458.      have any value.
  459.  
  460. 1805A Cross-assembler User Manual                              Page 10
  461.  
  462.  
  463. 5.0  Pseudo-operations
  464.  
  465. 5.1  BLK
  466.  
  467.      This statement is used to reserve a block of memory for working
  468.      storage, etc.  It requires one argument that gives the number of
  469.      bytes of storage to reserve.  The syntax is as follows:
  470.  
  471.           [label]   BLK       expression
  472.  
  473.  
  474. 5.2  BYTE
  475.  
  476.      This statement is used to place bytes in memory.  Each byte is
  477.      defined by an expression.  Multiple bytes can be defined by
  478.      expressions separated by commas.  If an expression evaluates to a
  479.      quantity outside the range -128 to 255, a value (V) error is
  480.      flagged.  The syntax follows:
  481.  
  482.           [label]   BYTE      [expr[,expr[,...]]]
  483.  
  484.  
  485. 5.3  Conditional Assembly
  486.  
  487.      Blocks of code can be assembled or not assembled based on the
  488.      value of some expression.  The basic syntax is as follows:
  489.  
  490.                     IF        expression
  491.  
  492.                     (lines of code)
  493.  
  494.                     ENDI
  495.  
  496.      If the expression evaluates to 0, the code will not be assembled.
  497.      The source lines will be transferred to the listing, but no hex
  498.      output will be generated.  It is recommended that a value of
  499.      0ffffh be used for a true value since it turns into a false value
  500.      under bitwise inversion.
  501.  
  502.      In addition, the ELSE directive is supported as follows:
  503.  
  504.                     IF        expression
  505.  
  506.                     (lines of code)
  507.  
  508.                     ELSE
  509.  
  510.                     (more lines of code)
  511.  
  512.                     ENDI
  513.  
  514. 1805A Cross-assembler User Manual                              Page 11
  515.  
  516.  
  517.      This is equivalent to:
  518.  
  519.                     IF        expression
  520.  
  521.                     (lines of code)
  522.  
  523.                     ENDI
  524.                     IF        NOT expression
  525.  
  526.                     (more lines of code)
  527.  
  528.                     ENDI
  529.  
  530.      Note that labels are not permitted on conditional assembly
  531.      directives.  Also, note that an END statement can fail to be
  532.      recognized if it is in a conditional assembly block with a false
  533.      expression.
  534.  
  535.      A phasing (P) error will be flagged if there are any forward
  536.      references in the expression.
  537.  
  538.  
  539. 5.4  CPU
  540.  
  541.      This statement is used to tell the assembler whether to assemble
  542.      code for the 1802 CPU or for the 1805A CPU.  The syntax is as
  543.      follows:
  544.  
  545.           [label]   CPU       expression
  546.  
  547.      If the expression evaluates to 1802 (decimal), the 1805A
  548.      extensions to the 1802 instruction set are disallowed.  If the
  549.      expression evaluates to 1805 (decimal), the 1805A extensions are
  550.      allowed.  Any other value results in a value (V) error and the
  551.      statement has no effect.  The default condition is "CPU 1802",
  552.      though the default can be changed by changing the "#define DEFEXT
  553.      FALSE" statement in a15.h and recompiling the assembler.
  554.  
  555.  
  556. 5.5  END
  557.  
  558.      When this statement is encountered, the assembler decides that
  559.      the end of the source file has been reached.  If this statement
  560.      is missing or in a conditional assembly block that is not being
  561.      assembled, the assembler will encounter end-of-file on the source
  562.      file.  In this case, the assembler will attach an END statement
  563.      and will flag a * error.  The syntax is as follows:
  564.  
  565.           [label]   END
  566.  
  567. 1805A Cross-assembler User Manual                              Page 12
  568.  
  569.  
  570.      If any IF statement is not closed with an ENDI at this point, an
  571.      if (I) error will be flagged.
  572.  
  573.      This statement permits no arguments.
  574.  
  575.  
  576. 5.6  EQU
  577.  
  578.      This statement is used to assign a permanent value to a symbol.
  579.      This value may not be subsequently changed by a SET, another EQU,
  580.      or by writing the symbol in column 1 as a label.  The syntax is
  581.      as follows:
  582.  
  583.           label     EQU       expression
  584.  
  585.      A phasing (P) error will result if any forward references are
  586.      encountered in the evaluation of the expression.
  587.  
  588.  
  589. 5.7  LOAD
  590.  
  591.      This statement is used to load a 16-bit immediate value into a
  592.      register of the 1802 which has no RLDI instruction.  It is, in
  593.      effect, a built-in macro.  The syntax is as follows:
  594.  
  595.           [label]   LOAD      reg, data
  596.  
  597.      The following sequence of instructions is placed into the code:
  598.  
  599.           [label]   LDI       HIGH data
  600.                     PHI       reg
  601.                     LDI       LOW data
  602.                     PLO       reg
  603.  
  604.      Note that execution of this macro blows up the D register.
  605.  
  606.  
  607. 5.8  ORG
  608.  
  609.      This statement is used to load a value into the assembly program
  610.      counter.  The value is obtained from the expression.  If the
  611.      expression contains any forward references, a phasing (P) error
  612.      will result.  If a label is present, it will be EQUed to the new
  613.      program counter value.  The syntax is:
  614.  
  615.           [label]   ORG       expression
  616.  
  617. 1805A Cross-assembler User Manual                              Page 13
  618.  
  619.  
  620. 5.9  PAGE
  621.  
  622.      This statement is used to set the assembly program counter to the
  623.      beginning of the next 256-byte page.  If the program counter is
  624.      already at the beginning of a page, the statement has no effect.
  625.      It permits no arguments, and it handles a label in the same way
  626.      as an ORG statement does.  The syntax is as follows:
  627.  
  628.           [label]   PAGE
  629.  
  630.  
  631. 5.10 SET
  632.  
  633.      This statement is used to assign a temporary value to a symbol.
  634.      The symbol may not be redefined by an EQU or by writing it in
  635.      column 1 as a label, but it may be redefined by another SET
  636.      statement.  The value for the symbol is obtained from the
  637.      expression.  If it contains forward references, a phasing (P)
  638.      error will result.  The syntax is:
  639.  
  640.           label     SET       expression
  641.  
  642.  
  643. 5.11 TEXT
  644.  
  645.      This statement is used to place strings in memory.  Its
  646.      arguments may only be strings.  Multiple strings may be placed
  647.      in memory if the strings are separated by commas.  The syntax is
  648.      as follows:
  649.  
  650.           [label]   TEXT      [string[,string[,...]]]
  651.  
  652.  
  653. 5.12 WORD
  654.  
  655.      This statement is used to place words in memory.  Each word is
  656.      defined by an expression.  Multiple words may be defined by
  657.      expressions separated by commas.  Words are placed in memory with
  658.      the high-order byte in the low-order memory location and the
  659.      low-order byte in the high-order memory location.  The syntax is
  660.      as follows:
  661.  
  662.           [label]   WORD      [expr[,expr[,...]]]
  663.  
  664. 1805A Cross-assembler User Manual                              Page 14
  665.  
  666.  
  667. 6.0  Error Messages
  668.  
  669.      Error messages are flagged with a single letter in column 1 of
  670.      the offending line in the listing.  The meaning of each letter
  671.      follows:
  672.  
  673.           B    Short branch was not to a location on the current page.
  674.                Note that the branch must go to the same page as $+1
  675.                ($+2 for BCI and BXI) is on.  Thus short branch
  676.                instructions at location 0xxffh (and 0xxfeh for BCI and
  677.                BXI) act strangely.  Don't ask me, I didn't invent the
  678.                instruction set!
  679.  
  680.           D    Digit too large for the base encountered.  In
  681.                particular, watch for 8 or 9 in an octal number and a-f
  682.                in a decimal number.
  683.  
  684.           E    Expression ill-formed.
  685.  
  686.           I    If stack imbalance.  Look for ELSE or ENDI without an
  687.                IF or an IF still open at the end of the file.
  688.  
  689.           L    Invalid label.  Label may contain invalid characters or
  690.                be equal to a reserved word like NOT.  Label may be
  691.                present on a conditional assembly directive.
  692.  
  693.           M    Label multiply defined.  Label defined more than once
  694.                and all definitions are not SET statements.
  695.  
  696.           O    Invalid opcode.  Look for misspellings, missing
  697.                semicolons, or opcodes in column 1.
  698.  
  699.           P    Phasing error.  Look for expressions in ORG, EQU, SET
  700.                or IF directives that contain forward references.  If
  701.                none exist, something weird is going on as a label that
  702.                was defined in pass 1 mysteriously vanished in pass 2.
  703.  
  704.           R    Register specification argument out of range (0-15) or
  705.                LDN R0 instruction.
  706.  
  707.           S    Syntax error.  Check your syntax against my samples.
  708.  
  709.           T    Too many arguments on this line.  WORD directives may
  710.                only define 127 words, while TEXT and BYTE directives
  711.                may only define 255 bytes.  On other statements, you
  712.                put superfluous arguments on the line.
  713.  
  714.           U    Undefined symbol encountered during expression
  715.                evaluation.
  716.  
  717. 1805A Cross-assembler User Manual                              Page 15
  718.  
  719.  
  720.           V    Value out of range.  In particular, BYTE expressions
  721.                and 8-bit immediate values must evaluate to -128 to
  722.                255, I/O port numbers must evaluate to 1 to 7, and CPU
  723.                types must evaluate to 1802 or 1805.
  724.  
  725.           *    This statement generated by the assembler.  Right now,
  726.                this only happens if you drop an END statement or
  727.                remove it through conditional assembly.
  728.  
  729.           "    Quote imbalance error.  Bear in mind that ' will not
  730.                terminate a string started with " and vice-versa.
  731.  
  732.           (    Parenthesis imbalance error.  Count them!
  733.  
  734. 1805A Cross-assembler User Manual                              Page 16
  735.  
  736.  
  737. 7.0  Assembler Abort Conditions
  738.  
  739.      Under certain circumstances, this assembler will just give up and
  740.      quit in middle of an assembly.  If you don't get the error count
  741.      diagnostic on the console, read your screen for sure!  The
  742.      following messages occur:
  743.  
  744.           1)   Can't open source.
  745.  
  746.                The source file does not exist on the specified disk
  747.                drive.
  748.  
  749.           2)   Can't open list.
  750.                Can't open hex.
  751.  
  752.                No directory entries left on the disk drive in
  753.                question.
  754.  
  755.           3)   Illegal command line.
  756.                No file info supplied
  757.  
  758.                Bone up on command lines.
  759.  
  760.           4)   If stack overflow.
  761.  
  762.                IF directives may only be nested 16 deep.  Rebuild your
  763.                source code to reduce your nesting depth, or change the
  764.                "#define IFDEPTH 16" statement in a15.h and recompile
  765.                the assembler.
  766.  
  767.           5)   Disk write error.
  768.  
  769.                Out of disk or directory space on the list or hex file.
  770.  
  771.           6)   Error closing file.
  772.  
  773.                You shouldn't get this one.
  774.  
  775.           7)   Symbol Table Overflow.
  776.  
  777.                Your source program defines too many symbols.  The
  778.                current limit is 500.  If you have more memory than I
  779.                do, you can change the "#define SYMBOLS 500" line in
  780.                a15.h and recompile the assembler.  Otherwise, you must
  781.                work on your source code.
  782.  
  783. 1805A Cross-assembler User Manual                              Page 17
  784.  
  785.  
  786. 8.0  Compiling the Assembler
  787.  
  788.      To compile the assembler as it stands, you will need the
  789.      following software tools:
  790.  
  791.           1)   40K+ of RAM
  792.  
  793.           2)   BDS C Compiler Version 1.4x with its CMAC.LIB macro
  794.                library or Version 1.5x with its CASM utility.
  795.  
  796.           3)   Digital Research's MAC Macro-assembler and the CP/M
  797.                LOAD utility (for BDS C 1.4x) or the CP/M ASM and DDT
  798.                utilities (for BDS C 1.5x).
  799.  
  800.      To get a15tbl1.crl and a15tbl2.crl up from scratch, you do the
  801.      following.  I assume that everything lives on drive A.
  802.  
  803.                BDS C 1.4x                         BDS C 1.5x
  804.  
  805.           A>mac a15tbl1 $szpz                A>cmac a15tbl1
  806.           A>mac a15tbl2 $szpz                A>cmac a15tbl2
  807.           A>load a15tbl1                     A>asm a15tbl1.aaz
  808.           A>load a15tbl2                     A>asm a15tbl2.aaz
  809.           A>ren a15tbl1.crl=a15tbl1.com      A>ddt a15tbl1.hex
  810.           A>ren a15tbl2.crl=a15tbl2.com      -g0
  811.                                              A>save 6 a15tbl1.crl
  812.                                              A>ddt a15tbl2.hex
  813.                                              -g0
  814.                                              A>save 4 a15tbl2.crl
  815.  
  816.      You should now have a15tbl1.crl and a15tbl2.crl on drive A. Erase
  817.      the artifacts a15tbl1.hex and a15tbl2.hex (also a15tbl1.asm and
  818.      a15tbl2.asm if you're using BDS C 1.5x) if you want to.
  819.  
  820.      Now you are ready to compile the rest of the beast like this:
  821.  
  822.           A>cc a15.c -e4600
  823.           A>cc a15asmln -e4600
  824.           A>cc a15eval -e4600
  825.           A>cc a15get -e4600
  826.           A>cc a15put -e4600
  827.           A>cc a15symb -e4600
  828.  
  829.      Now you can link it all together like this (all on one line):
  830.  
  831.           A>clink a15 a15asmln a15eval a15get a15put
  832.                     a15symb a15tbl1 a15tbl2
  833.  
  834.      And, as if by magic, you've got a15.com on drive A.  Note that if
  835.      you have more than 40K of RAM, you may want to increase your
  836.      symbol table size.  Symbols are 10 bytes each, so plan
  837.      accordingly.
  838.  
  839. 1805A Cross-assembler User Manual                              Page 18
  840.  
  841.  
  842. 9.0  Final Comments
  843.  
  844.      Happy hacking!  If you have questions or note any bugs, I'd
  845.      appreciate a shout at (216)288-1122 x469 days or at (216)775-3680
  846.      evenings.  The questions will point out weaknesses in the manual,
  847.      and the bugs need to be stamped upon unmercifully.
  848.  
  849.                                                   WCC3
  850.                                               20-JUN-1985
  851.  A>cc a15asmln -e4